#include "Normal.hpp"

#ifndef __NORMAL_CPP__
#define __NORMAL_CPP__

namespace asteroids
{

template <class T>
Normal<T>::Normal(T _x, T _y, T _z)
{
    // Set the given values
    Vertex<T>::m_x = _x;
    Vertex<T>::m_y = _y;
    Vertex<T>::m_z = _z; 
      
    //normalize
    try {
        Vertex<T>::normalize();
    } catch (std::invalid_argument &ia) {
        std::cout << ia.what() << std::endl;
    }
}

template <class T>
Normal<T>::Normal(const Vertex<T>& vec )
{
    // Set the given values
    Vertex<T>::m_x = vec[0];
    Vertex<T>::m_y = vec[1];
    Vertex<T>::m_z = vec[2];
    
    //normalize
    try {
        Vertex<T>::normalize();
    } catch (std::invalid_argument &ia) {
        std::cout << ia.what() << std::endl;
    }
}

}

#endif